package com.yww.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yww.entity.StuParam;
import com.yww.entity.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 雯雯yang婷婷
 * @since 2020-06-02
 */
public interface StudentMapper extends BaseMapper<Student> {
    //删除学生
    @Delete("delete * from student where stu_id=#{id}")
    Integer delStu(Integer id);

    boolean updateBatch(@Param("userId")Integer userId,@Param("ids")String ids);


    /**
     * 下载（批量导出）
     * @param ids
     * @return
     */
    List<Student> exportStudent(String[] ids);

    //查看分配给咨询师的学生信息
    List<StuParam> selectStuListByCon(StuParam stuParam);

    //查看分配给网络咨询师的学生信息
    List<StuParam> selectStuListByWWWCon(StuParam stuParam);

    //批量删除
    Integer delBatchId(String[] ids);

    //批量分配
    Integer updBatchId(@Param("ids") String[] ids,@Param("usersId") Integer usersId);


    //查询学生列表
    List<StuParam>  getStuList(StuParam stuParam);

    List<StuParam>  getStuListDelete(StuParam stuParam);

    //手动分配进班
    boolean updateBatchClass(@Param("id") Integer id,@Param("ids") String[] ids);

    //全查 查询已经缴费的同学
    List<StuParam> getStuListByIsPay(StuParam stuParam);

//修改
    @Update("update student set stu_concern=#{num} where stu_id=#{sid}")
    boolean updateStuConcern(@Param("num") Integer num,@Param("sid")Integer sid);




}
